/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package LDAPConn;

import java.util.HashMap;
import org.forgerock.opendj.ldap.Attribute;
import org.forgerock.opendj.ldap.responses.SearchResultEntry;

/**
 *
 * @author anvil
 */
public class Entry {
    private SearchResultEntry entry;
    
    public Entry(SearchResultEntry e) {
        this.entry = e;
    }
    
    public String getName() {
        return this.entry.getName().toString();
    }
    
    public HashMap<String,String> getAttributes() {
        return null;
    }
    
    public HashMap<String,String> getAttributeValues() {
        HashMap<String,String> h = new HashMap<String,String>();
        
        for (Attribute at : this.entry.getAllAttributes()) {
            h.put(at.getAttributeDescriptionAsString(), at.firstValueAsString());
        }
        
        return h;
    }
}
